﻿using DryIoc;
using SolidWorks.Interop.sldworks;

namespace Compass.Wpf.SwServices;

public class SupplyService : BaseSwService, ISupplyService
{
    public SupplyService(IContainerProvider provider) : base(provider)
    {
    }

    #region 公开方法
    #region 标准烟罩
    public void I555(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_555-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);


        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //2024.04.07,新风面板的安装方式与法国烟罩统一，改成从内部安装
        //新风主体
        FNHA0001(swAssyLevel1, suffix, "FNHA0001-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, frontPanelNutDis, exhaustType);
        //I新风底部CJ孔板
        FNHA0002(swAssyLevel1, suffix, "FNHA0002-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);
        //I新风前面板
        FNHA0003(swAssyLevel1, suffix, "FNHA0003-1", length, 555d, midRoofNutDis, frontPanelNutDis);

        //集水翻边
        const double suHeight = 555d;
        const string leftPart = "FNHS0005-1";
        const string rightPart = "FNHS0006-1";
        WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }

    public void IR555(AssemblyDoc swAssyTop, string suffix, double outerRadius, double innerRadius, double netLength, bool bluetooth,
        bool waterCollection)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_R_555-1", Aggregator);

        swAssyLevel1.ChangePartLength(suffix, "FNHA0048-1", "Radius@SketchBase", outerRadius, Aggregator);

        FNHA0049(swAssyLevel1, suffix, "FNHA0049-1", innerRadius);

        FNHA0050(swAssyLevel1, suffix, "FNHA0050-1", outerRadius, innerRadius);

        FNHA0051(swAssyLevel1, suffix, "FNHA0051-1", outerRadius, innerRadius, netLength);

        swAssyLevel1.ChangePartLength(suffix, "FNHM0009-1", "Radius@SketchFlange", outerRadius-1d, Aggregator);

        FNHM0020(swAssyLevel1, suffix, "FNHM0020-1", outerRadius, bluetooth);

        if (waterCollection)
        {
            swAssyLevel1.UnSuppress(suffix, "FNHA0125-1", Aggregator);
            swAssyLevel1.ChangePartLength(suffix, "FNHA0126-1", "Radius@SketchBase", innerRadius, Aggregator);
            swAssyLevel1.ChangePartLength(suffix, "FNHA0127-1", "Radius@SketchBase", innerRadius-40d, Aggregator);
            FNHA0128(swAssyLevel1, suffix, "FNHA0128-1", innerRadius);
            swAssyLevel1.UnSuppress("LocalCirPatternWaterCollection");
        }
        else
        {
            swAssyLevel1.Suppress("LocalCirPatternWaterCollection");
            swAssyLevel1.Suppress(suffix, "FNHA0125-1");
            swAssyLevel1.Suppress(suffix, "FNHA0126-1");
            swAssyLevel1.Suppress(suffix, "FNHA0127-1");
            swAssyLevel1.Suppress(suffix, "FNHA0128-1");
        }
    }


    public void IM555(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_555-1", Aggregator);

        //将width换算成普通烟罩的width
        var netWidth = (width - 800d) / 2 + 535d;

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);


        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //2024.04.07,新风面板的安装方式与法国烟罩统一，改成从内部安装
        //新风主体
        FNHA0001(swAssyLevel1, suffix, "FNHA0001-1", length, netWidth, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, frontPanelNutDis, exhaustType);
        //I新风底部CJ孔板
        FNHA0002(swAssyLevel1, suffix, "FNHA0002-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);
        //I新风前面板
        FNHA0003(swAssyLevel1, suffix, "FNHA0003-1", length, 555d, midRoofNutDis, frontPanelNutDis);

        //不要集水翻边
        swAssyLevel1.Suppress(suffix, "FNHS0005-1");
        swAssyLevel1.Suppress(suffix, "FNHS0006-1");

        //背面
        var swAssyBack = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_M_555-1", Aggregator);
        //新风主体
        FNHA0085(swAssyBack, suffix, "FNHA0085-1", length, netWidth, midRoofNutDis, frontPanelNutDis, exhaustType);
        //I新风底部CJ孔板
        FNHA0086(swAssyBack, suffix, "FNHA0086-1", length, sidePanel, waterCollection, frontPanelNutDis);


    }
    public void IFr555(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, LightType_e lightType, int spotLightNumber, double spotLightDistance, bool ansul, int ansulDropNumber, double ansulDropToFront, double ansulDropDis1, double ansulDropDis2, double ansulDropDis3, double ansulDropDis4, double ansulDropDis5)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_FR_555-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        //const double minMidRoofNutDis = 450d;
        //var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        //midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        //var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //底部CJ孔板
        FNHA0002(swAssyLevel1, suffix, "FNHA0115-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);

        //新风主体
        FNHA0116(swAssyLevel1, suffix, "FNHA0116-1", length, width, marvel, frontPanelNutDis, lightType, spotLightNumber, spotLightDistance, ansul, ansulDropNumber, ansulDropToFront, ansulDropDis1, ansulDropDis2, ansulDropDis3, ansulDropDis4, ansulDropDis5);

        //新风顶面
        FNHA0117(swAssyLevel1, suffix, "FNHA0117-1", length, width, sidePanel, uvLightType, bluetooth, marvel, frontPanelNutDis, 0, 0);


        //F新风前面板，FNHA0111
        FNHA0111(swAssyLevel1, suffix, "FNHA0119-1", length, 555d, frontPanelNutDis);



        //集水翻边
        const double suHeight = 555d;
        const string leftPart = "FNHS0077-1";
        const string rightPart = "FNHS0078-1";
        WaterCollectionFr(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);


        //IR安装支架
        if (marvel) swAssyLevel1.UnSuppress(suffix, "IR_LHC_2-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "IR_LHC_2-1");
    }

    public void I450(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_450-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //新风主体
        FNHA0001(swAssyLevel1, suffix, "FNHA0077-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, frontPanelNutDis, exhaustType);
        //I新风底部CJ孔板
        FNHA0002(swAssyLevel1, suffix, "FNHA0002-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);
        //I新风前面板
        FNHA0003(swAssyLevel1, suffix, "FNHA0003-1", length, 450d, midRoofNutDis, frontPanelNutDis);

        //集水翻边
        const double suHeight = 450d;
        const string leftPart = "FNHS0005-1";
        const string rightPart = "FNHS0006-1";
        WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }

    public void IFr450(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, LightType_e lightType, int spotLightNumber, double spotLightDistance, bool ansul, int ansulDropNumber, double ansulDropToFront, double ansulDropDis1, double ansulDropDis2, double ansulDropDis3, double ansulDropDis4, double ansulDropDis5)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_FR_450-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        //const double minMidRoofNutDis = 450d;
        //var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        //midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        //var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //底部CJ孔板
        FNHA0002(swAssyLevel1, suffix, "FNHA0115-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);

        //新风主体
        FNHA0116(swAssyLevel1, suffix, "FNHA0138-1", length, width, marvel, frontPanelNutDis, lightType, spotLightNumber, spotLightDistance, ansul, ansulDropNumber, ansulDropToFront, ansulDropDis1, ansulDropDis2, ansulDropDis3, ansulDropDis4, ansulDropDis5);

        //新风顶面
        FNHA0117(swAssyLevel1, suffix, "FNHA0117-1", length, width, sidePanel, uvLightType, bluetooth, marvel, frontPanelNutDis, 0, 0);


        //F新风前面板，FNHA0111
        FNHA0111(swAssyLevel1, suffix, "FNHA0119-1", length, 555d, frontPanelNutDis);



        //集水翻边
        const double suHeight = 555d;
        const string leftPart = "FNHS0077-1";
        const string rightPart = "FNHS0078-1";
        WaterCollectionFr(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);


        //IR安装支架
        if (marvel) swAssyLevel1.UnSuppress(suffix, "IR_LHC_2-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "IR_LHC_2-1");
    }


    public void I400(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_400-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //新风主体
        FNHA0001(swAssyLevel1, suffix, "FNHA0040-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, frontPanelNutDis, exhaustType);
        //I新风底部CJ孔板
        FNHA0002(swAssyLevel1, suffix, "FNHA0002-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);
        //I新风前面板
        FNHA0003(swAssyLevel1, suffix, "FNHA0003-1", length, 400d, midRoofNutDis, frontPanelNutDis);

        //集水翻边
        const double suHeight = 400d;
        const string leftPart = "FNHS0005-1";
        const string rightPart = "FNHS0006-1";
        WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }


    public void ITs700(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_TS_700-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;

        //const double minFrontPanelNutDis = 580d;
        //var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        //frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        //var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);


        //中东烟罩，需要黑色盖板，2米以上4个，2米到1.2米3个，1.2米2个
        var blackCoverNumber = length>=2000d ? 4 : length>=1200d && length<2000d ? 3 : 2;
        var blackCoverDis = (length -  500d) / (blackCoverNumber - 1);


        //新风主体
        FSHA0006(swAssyLevel1, suffix, "FSHA0006-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, exhaustType);
        //I新风底部CJ孔板
        FSHA0007(swAssyLevel1, suffix, "FSHA0007-1", length, sidePanel, bluetooth, ledLogo, waterCollection, blackCoverDis);

        //I新风前面板
        FSHA0008(swAssyLevel1, suffix, "FSHA0008-1", length, 555d, midRoofNutDis, blackCoverDis);

        //集水翻边
        //const double suHeight = 555d;
        //const string leftPart = "FNHS0005-1";
        //const string rightPart = "FNHS0006-1";
        //WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }


    public void F555(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, int supplySpigotNumber, double supplySpigotDis)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_F_555-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //新风网孔板加强筋
        if (length > 1599d) swAssyLevel1.UnSuppress(suffix, "FNHA0011-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "FNHA0011-1");


        //新风主体
        FNHA0004(swAssyLevel1, suffix, "FNHA0004-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, frontPanelNutDis, supplySpigotNumber, supplySpigotDis);

        //F新风底部CJ孔板,FNHA0005重用FNHA0002方法
        FNHA0002(swAssyLevel1, suffix, "FNHA0005-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);

        //F新风前面板，FNHA0007
        FNHA0007(swAssyLevel1, suffix, "FNHA0007-1", length, 555d, midRoofNutDis, frontPanelNutDis);

        //镀锌板
        FNHA0006(swAssyLevel1, suffix, "FNHA0006-1", length, frontPanelNutDis);

        //新风滑门导轨
        FNHA0010(swAssyLevel1, suffix, "FNHA0010-1", length);
        FNHA0010(swAssyLevel1, suffix, "FNHE0010-1", length);

        //集水翻边
        const double suHeight = 555d;
        const string leftPart = "FNHS0005-1";
        const string rightPart = "FNHS0006-1";
        WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }

    public void FFr555(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, int supplySpigotNumber, double supplySpigotDis, LightType_e lightType, int spotLightNumber, double spotLightDistance, bool ansul, int ansulDropNumber, double ansulDropToFront, double ansulDropDis1, double ansulDropDis2, double ansulDropDis3, double ansulDropDis4, double ansulDropDis5)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_F_FR_555-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        //const double minMidRoofNutDis = 450d;
        //var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        //midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        //var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        ////新风网孔板加强筋
        //if (length > 1599d) swAssyLevel1.UnSuppress(suffix, "FNHA0011-1", Aggregator);
        //else swAssyLevel1.Suppress(suffix, "FNHA0011-1");


        //F新风底部CJ孔板,FNHA0115重用FNHA0002方法
        FNHA0002(swAssyLevel1, suffix, "FNHA0115-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);

        //F新风前面板，FNHA0111
        FNHA0111(swAssyLevel1, suffix, "FNHA0111-1", length, 555d, frontPanelNutDis);

        //新风主体
        FNHA0116(swAssyLevel1, suffix, "FNHA0116-1", length, width, marvel, frontPanelNutDis, lightType, spotLightNumber, spotLightDistance, ansul, ansulDropNumber, ansulDropToFront, ansulDropDis1, ansulDropDis2, ansulDropDis3, ansulDropDis4, ansulDropDis5);

        //新风顶面
        FNHA0117(swAssyLevel1, suffix, "FNHA0117-1", length, width, sidePanel, uvLightType, bluetooth, marvel, frontPanelNutDis, supplySpigotNumber, supplySpigotDis);

        //镀锌板
        FNHA0112(swAssyLevel1, suffix, "FNHA0112-1", length, frontPanelNutDis);

        //新风滑门导轨
        FNHA0010(swAssyLevel1, suffix, "FNHA0010-1", length);
        FNHA0010(swAssyLevel1, suffix, "FNHE0010-1", length);

        //集水翻边
        const double suHeight = 555d;
        const string leftPart = "FNHS0077-1";
        const string rightPart = "FNHS0078-1";
        WaterCollectionFr(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);


        //IR安装支架
        if (marvel) swAssyLevel1.UnSuppress(suffix, "IR_LHC_2-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "IR_LHC_2-1");
    }

    public void FFr450(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, int supplySpigotNumber, double supplySpigotDis, LightType_e lightType, int spotLightNumber, double spotLightDistance, bool ansul, int ansulDropNumber, double ansulDropToFront, double ansulDropDis1, double ansulDropDis2, double ansulDropDis3, double ansulDropDis4, double ansulDropDis5)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_F_FR_450-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        //const double minMidRoofNutDis = 450d;
        //var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        //midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        //var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        ////新风网孔板加强筋
        //if (length > 1599d) swAssyLevel1.UnSuppress(suffix, "FNHA0011-1", Aggregator);
        //else swAssyLevel1.Suppress(suffix, "FNHA0011-1");


        //F新风底部CJ孔板,FNHA0115重用FNHA0002方法
        FNHA0002(swAssyLevel1, suffix, "FNHA0115-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);

        //F新风前面板，FNHA0111
        FNHA0111(swAssyLevel1, suffix, "FNHA0111-1", length, 450d, frontPanelNutDis);

        //新风主体
        FNHA0116(swAssyLevel1, suffix, "FNHA0138-1", length, width, marvel, frontPanelNutDis, lightType, spotLightNumber, spotLightDistance, ansul, ansulDropNumber, ansulDropToFront, ansulDropDis1, ansulDropDis2, ansulDropDis3, ansulDropDis4, ansulDropDis5);

        //新风顶面
        FNHA0117(swAssyLevel1, suffix, "FNHA0117-1", length, width, sidePanel, uvLightType, bluetooth, marvel, frontPanelNutDis, supplySpigotNumber, supplySpigotDis);

        //镀锌板
        FNHA0112(swAssyLevel1, suffix, "FNHA0139-1", length, frontPanelNutDis);

        //新风滑门导轨
        FNHA0010(swAssyLevel1, suffix, "FNHA0010-1", length);
        FNHA0010(swAssyLevel1, suffix, "FNHE0010-1", length);

        //集水翻边
        const double suHeight = 450d;
        const string leftPart = "FNHS0077-1";
        const string rightPart = "FNHS0078-1";
        WaterCollectionFr(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);


        //IR安装支架
        if (marvel) swAssyLevel1.UnSuppress(suffix, "IR_LHC_2-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "IR_LHC_2-1");
    }

    public void F400(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, int supplySpigotNumber, double supplySpigotDis)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_F_400-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //新风网孔板加强筋
        if (length > 1599d) swAssyLevel1.UnSuppress(suffix, "FNHA0030-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "FNHA0030-1");


        //新风主体
        FNHA0004(swAssyLevel1, suffix, "FNHA0021-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, frontPanelNutDis, supplySpigotNumber, supplySpigotDis);

        //F新风底部CJ孔板,FNHA0005重用FNHA0002方法
        FNHA0002(swAssyLevel1, suffix, "FNHA0005-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);

        //F新风前面板，FNHA0007
        FNHA0007(swAssyLevel1, suffix, "FNHA0007-1", length, 400d, midRoofNutDis, frontPanelNutDis);

        //镀锌板
        FNHA0006(swAssyLevel1, suffix, "FNHA0022-1", length, frontPanelNutDis);

        //新风滑门导轨
        FNHA0010(swAssyLevel1, suffix, "FNHA0010-1", length);
        FNHA0010(swAssyLevel1, suffix, "FNHE0010-1", length);

        //集水翻边
        const double suHeight = 400d;
        const string leftPart = "FNHS0005-1";
        const string rightPart = "FNHS0006-1";
        WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }

    public void FTs700(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, int supplySpigotNumber, double supplySpigotDis)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_F_TS_700-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;

        //const double minFrontPanelNutDis = 580d;
        //var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        //frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        //var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);


        //中东烟罩，需要黑色盖板，2米以上4个，2米到1.2米3个，1.2米2个
        var blackCoverNumber = length>=2000d ? 4 : length>=1200d && length<2000d ? 3 : 2;
        var blackCoverDis = (length -  500d) / (blackCoverNumber - 1);


        //新风网孔板加强筋
        if (length > 1599d) swAssyLevel1.UnSuppress(suffix, "FNHA0011-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "FNHA0011-1");

        //新风主体
        FSHA0011(swAssyLevel1, suffix, "FSHA0011-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, supplySpigotNumber, supplySpigotDis, exhaustType);


        //F新风底部CJ孔板
        FSHA0007(swAssyLevel1, suffix, "FSHA0010-1", length, sidePanel, bluetooth, ledLogo, waterCollection, blackCoverDis);

        //F新风前面板
        FSHA0008(swAssyLevel1, suffix, "FSHA0012-1", length, 555d, midRoofNutDis, blackCoverDis);


        //镀锌板
        swAssyLevel1.ChangePartLength(suffix, "FSHA0013-1", "Length@SketchBase", length - 6d, Aggregator);

        //新风滑门导轨
        FNHA0010(swAssyLevel1, suffix, "FNHA0010-1", length);
        FNHA0010(swAssyLevel1, suffix, "FNHE0010-1", length);

        //集水翻边
        //const double suHeight = 555d;
        //const string leftPart = "FNHS0005-1";
        //const string rightPart = "FNHS0006-1";
        //WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }



    public void BackCj(AssemblyDoc swAssyTop, string suffix, bool backCj, double length, double height, double cjSpigotToRight)
    {
        if (!backCj)
        {
            swAssyTop.Suppress(suffix, "BackCj_Fs-1");
            return;
        }
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "BackCj_Fs-1", Aggregator);

        const double cjHoleDis = 30d;//天花烟罩马蹄形CJ孔阵列距离为30
        const double minCjDis = 20d;//距边最小距离
        int cjNumber = (int)((length - 2* minCjDis) / cjHoleDis);
        double firstCjDis = (length - cjHoleDis * cjNumber) / 2d;
        if (firstCjDis < minCjDis) firstCjDis += minCjDis;

        FNHA0084(swAssyLevel1, suffix, "FNHA0084-1", length, height, firstCjDis, cjSpigotToRight);

        FNCJ0016(swAssyLevel1, suffix, "FNCJ0016-1", length);

        FNHE0102(swAssyLevel1, suffix, "FNHE0102-1", height);
    }

    public void BackCjFr(AssemblyDoc swAssyTop, string suffix, bool backCj, double length, double height, double cjSpigotToRight)
    {
        if (!backCj)
        {
            swAssyTop.Suppress(suffix, "BackCj_Fr-1");
            return;
        }
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "BackCj_Fr-1", Aggregator);

        const double cjHoleDis = 30d;//天花烟罩马蹄形CJ孔阵列距离为30
        const double minCjDis = 20d;//距边最小距离
        int cjNumber = (int)((length - 2* minCjDis) / cjHoleDis);
        double firstCjDis = (length - cjHoleDis * cjNumber) / 2d;
        if (firstCjDis < minCjDis) firstCjDis += minCjDis;

        FNHA0084(swAssyLevel1, suffix, "FNHA0135-1", length, height, firstCjDis, cjSpigotToRight);

        FNCJ0016(swAssyLevel1, suffix, "FNCJ0016-1", length);
    }

    #endregion

    #region 华为烟罩
    public void IHw650(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_I_HW_650-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //新风主体
        FNHA0113(swAssyLevel1, suffix, "FNHA0113-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis);
        //I新风底部CJ孔板
        FNHA0002(swAssyLevel1, suffix, "FNHA0114-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);
        //I新风前面板
        FNHA0003(swAssyLevel1, suffix, "FNHA0120-1", length, 555d, midRoofNutDis, frontPanelNutDis);

        //集水翻边
        const double suHeight = 650d;
        const string leftPart = "FNHS0071-1";
        const string rightPart = "FNHS0072-1";
        WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }

    public void FHw650(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, int supplySpigotNumber, double supplySpigotDis)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_F_HW_650-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //新风网孔板加强筋
        if (length > 1599d) swAssyLevel1.UnSuppress(suffix, "FNHA0124-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "FNHA0124-1");


        //新风主体
        FNHA0108(swAssyLevel1, suffix, "FNHA0108-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, supplySpigotNumber, supplySpigotDis);

        //F新风底部CJ孔板,FNHA0005重用FNHA0002方法
        FNHA0002(swAssyLevel1, suffix, "FNHA0093-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);

        //F新风前面板，FNHA0007
        //2024.06.19，华为要多减去1mm
        FNHA0007(swAssyLevel1, suffix, "FNHA0107-1", length-1d, 555d, midRoofNutDis, frontPanelNutDis);

        //镀锌板
        //2024.06.19，华为要多减去1mm
        FNHA0006(swAssyLevel1, suffix, "FNHA0006-1", length-1d, frontPanelNutDis);

        //新风滑门导轨
        FNHA0097(swAssyLevel1, suffix, "FNHA0097-1", length);

        #region 新风脖颈
        if (supplySpigotNumber == 1)
        {
            swAssyLevel1.Suppress("LocalLPatternSu250");
        }
        else
        {
            swAssyLevel1.UnSuppress("LocalLPatternSu250");
            var swModelLevel1 = (ModelDoc2)swAssyLevel1;
            swModelLevel1.ChangeDim("Number@LocalLPatternSu250", supplySpigotNumber);
            swModelLevel1.ChangeDim("Dis@LocalLPatternSu250", supplySpigotDis);
        }
        #endregion

        //集水翻边
        const double suHeight = 650d;
        const string leftPart = "FNHS0071-1";
        const string rightPart = "FNHS0072-1";
        WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }

    public void FHw555(AssemblyDoc swAssyTop, string suffix, double length, double width, double height, ExhaustType_e exhaustType, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, bool ledLogo, bool waterCollection, int supplySpigotNumber, double supplySpigotDis)
    {
        var swAssyLevel1 = swAssyTop.GetSubAssemblyDoc(suffix, "Supply_F_HW_555-1", Aggregator);

        //新风面板螺丝孔数量及间距,最小间距580，距离边缘150 2023/6/20
        const double sideDis = 150d;
        const double minFrontPanelNutDis = 580d;
        var frontPanelNutNumber = Math.Ceiling((length - 2*sideDis) / minFrontPanelNutDis);
        frontPanelNutNumber = frontPanelNutNumber < 2d ? 2d : frontPanelNutNumber;
        var frontPanelNutDis = (length -  2*sideDis) / (frontPanelNutNumber - 1);

        //MidRoof铆螺母孔 2023/3/10
        //修改MidRoof螺丝孔逻辑，以最低450间距计算间距即可
        const double minMidRoofNutDis = 450d;
        var midRoofNutNumber = Math.Ceiling((length - 2*sideDis) / minMidRoofNutDis);
        midRoofNutNumber = midRoofNutNumber < 3d ? 3d : midRoofNutNumber;
        var midRoofNutDis = (length -  2*sideDis)/(midRoofNutNumber-1);

        //新风网孔板加强筋
        if (length > 1599d) swAssyLevel1.UnSuppress(suffix, "FNHA0124-1", Aggregator);
        else swAssyLevel1.Suppress(suffix, "FNHA0124-1");


        //新风主体
        FNHA0108(swAssyLevel1, suffix, "FNHA0106-1", length, width, sidePanel, uvLightType, bluetooth, marvel, midRoofNutDis, supplySpigotNumber, supplySpigotDis);

        //F新风底部CJ孔板,FNHA0005重用FNHA0002方法
        FNHA0002(swAssyLevel1, suffix, "FNHA0093-1", length, sidePanel, bluetooth, ledLogo, waterCollection, frontPanelNutDis);

        //F新风前面板，FNHA0007
        //2024.06.19，华为要多减去1mm
        FNHA0007(swAssyLevel1, suffix, "FNHA0107-1", length-1d, 555d, midRoofNutDis, frontPanelNutDis);

        //镀锌板
        //2024.06.19，华为要多减去1mm
        FNHA0006(swAssyLevel1, suffix, "FNHA0006-1", length-1d, frontPanelNutDis);

        //新风滑门导轨
        FNHA0097(swAssyLevel1, suffix, "FNHA0097-1", length);

        #region 新风脖颈
        if (supplySpigotNumber == 1)
        {
            swAssyLevel1.Suppress("LocalLPatternSu250");
        }
        else
        {
            swAssyLevel1.UnSuppress("LocalLPatternSu250");
            var swModelLevel1 = (ModelDoc2)swAssyLevel1;
            swModelLevel1.ChangeDim("Number@LocalLPatternSu250", supplySpigotNumber);
            swModelLevel1.ChangeDim("Dis@LocalLPatternSu250", supplySpigotDis);
        }
        #endregion

        //集水翻边
        const double suHeight = 650d;
        const string leftPart = "FNHS0071-1";
        const string rightPart = "FNHS0072-1";
        WaterCollection(swAssyLevel1, suffix, waterCollection, sidePanel, exhaustType, width, height, suHeight, leftPart, rightPart);
    }
    #endregion 
    #endregion

    #region 集水翻边

    private void WaterCollection(AssemblyDoc swAssyLevel1, string suffix, bool waterCollection, SidePanel_e sidePanel, ExhaustType_e exhaustType, double width, double height, double suHeight, string leftPart, string rightPart)
    {
        if (waterCollection)
        {
            if (sidePanel == SidePanel_e.双)
            {
                FNHS0005(swAssyLevel1, suffix, leftPart, width, height, exhaustType, suHeight);
                FNHS0005(swAssyLevel1, suffix, rightPart, width, height, exhaustType, suHeight);
            }
            else if (sidePanel == SidePanel_e.左)
            {
                FNHS0005(swAssyLevel1, suffix, leftPart, width, height, exhaustType, suHeight);
                swAssyLevel1.Suppress(suffix, rightPart);
            }
            else if (sidePanel == SidePanel_e.右)
            {
                swAssyLevel1.Suppress(suffix, leftPart);
                FNHS0005(swAssyLevel1, suffix, rightPart, width, height, exhaustType, suHeight);
            }
            else
            {
                swAssyLevel1.Suppress(suffix, leftPart);
                swAssyLevel1.Suppress(suffix, rightPart);
            }
        }
        else
        {
            swAssyLevel1.Suppress(suffix, leftPart);
            swAssyLevel1.Suppress(suffix, rightPart);
        }
    }


    private void FNHS0005(AssemblyDoc swAssyLevel1, string suffix, string partName, double width, double height, ExhaustType_e exhaustType, double suHeight)
    {
        // KVUV555排风尺寸，     ExHeitht555，ExButton76.5，ExFront85,ExAngle135
        // KWUW排风尺寸，        ExHeitht555，ExButton150，ExFront101,ExAngle145
        // 450高度排风没有水洗，  ExHeitht450，ExButton105，ExFront50,ExAngle135
        var exButton = height.Equals(450d) ? 105d : exhaustType == ExhaustType_e.KW||exhaustType == ExhaustType_e.UW ? 150d : 76.5d;
        var exFront = height.Equals(450d) ? 50d : exhaustType == ExhaustType_e.KW||exhaustType == ExhaustType_e.UW ? 101d : 85d;
        // 角度特殊，不能除以1000,应当乘回去
        var exAngle = (height.Equals(450d) ? 135d : exhaustType == ExhaustType_e.KW||exhaustType == ExhaustType_e.UW ? 145d : 135d)*1000d* Math.PI/ 180d;

        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);//todo:?
        swModelLevel2.ChangeDim("Width@SketchHood", width);
        swModelLevel2.ChangeDim("SuHeight@SketchHood", suHeight);//新风
        swModelLevel2.ChangeDim("ExHeight@SketchHood", height);//排风

        swModelLevel2.ChangeDim("ExButton@SketchHood", exButton);
        swModelLevel2.ChangeDim("ExFront@SketchHood", exFront);
        swModelLevel2.ChangeDim("ExAngle@SketchHood", exAngle);
    }

    private void WaterCollectionFr(AssemblyDoc swAssyLevel1, string suffix, bool waterCollection, SidePanel_e sidePanel, ExhaustType_e exhaustType, double width, double height, double suHeight, string leftPart, string rightPart)
    {
        if (waterCollection)
        {
            if (sidePanel == SidePanel_e.双)
            {
                FNHS0077(swAssyLevel1, suffix, leftPart, width, height, exhaustType, suHeight);
                FNHS0077(swAssyLevel1, suffix, rightPart, width, height, exhaustType, suHeight);
            }
            else if (sidePanel == SidePanel_e.左)
            {
                FNHS0077(swAssyLevel1, suffix, leftPart, width, height, exhaustType, suHeight);
                swAssyLevel1.Suppress(suffix, rightPart);
            }
            else if (sidePanel == SidePanel_e.右)
            {
                swAssyLevel1.Suppress(suffix, leftPart);
                FNHS0077(swAssyLevel1, suffix, rightPart, width, height, exhaustType, suHeight);
            }
            else
            {
                swAssyLevel1.Suppress(suffix, leftPart);
                swAssyLevel1.Suppress(suffix, rightPart);
            }
        }
        else
        {
            swAssyLevel1.Suppress(suffix, leftPart);
            swAssyLevel1.Suppress(suffix, rightPart);
        }
    }

    private void FNHS0077(AssemblyDoc swAssyLevel1, string suffix, string partName, double width, double height, ExhaustType_e exhaustType, double suHeight)
    {
        // KVUV555排风尺寸，     ExHeitht555，ExButton76.5，ExFront85,ExAngle135
        // KWUW排风尺寸，        ExHeitht555，ExButton150，ExFront101,ExAngle145
        // 450高度排风没有水洗，  ExHeitht450，ExButton105，ExFront50,ExAngle135
        var exButton = height.Equals(450d) ? 105d : exhaustType == ExhaustType_e.KW||exhaustType == ExhaustType_e.UW ? 150d : 76.5d;
        var exFront = height.Equals(450d) ? 50d : exhaustType == ExhaustType_e.KW||exhaustType == ExhaustType_e.UW ? 101d : 85d;
        // 角度特殊，不能除以1000,应当乘回去
        var exAngle = (height.Equals(450d) ? 135d : exhaustType == ExhaustType_e.KW||exhaustType == ExhaustType_e.UW ? 145d : 135d)*1000d* Math.PI/ 180d;

        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);//todo:?
        swModelLevel2.ChangeDim("Width@Base-Flange", width - 283.5d);
        //swModelLevel2.ChangeDim("Width@SketchHood", width);
        //swModelLevel2.ChangeDim("SuHeight@SketchHood", suHeight);//新风
        //swModelLevel2.ChangeDim("ExHeight@SketchHood", height);//排风

        //swModelLevel2.ChangeDim("ExButton@SketchHood", exButton);
        //swModelLevel2.ChangeDim("ExFront@SketchHood", exFront);
        //swModelLevel2.ChangeDim("ExAngle@SketchHood", exAngle);
    }

    #endregion

    #region I555
    private void FNHA0001(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, double midRoofNutDis, double frontPanelNutDis, ExhaustType_e exhaustType)
    {
        //因为后方一点距离前端固定90，这里计算前端一点移动的距离
        var exWidth = exhaustType is ExhaustType_e.CMOD ? 294d : 535d;//排风宽度
        const double suWidth = 360d;//新风宽度
        const double holeDis = 50d;//两孔间距，槽钢开孔50
        var fixDis = exWidth+suWidth+ 90d;//减去的固定间距为孔距边90和新风排风宽度

        var midRoofTopHoleDis = width - fixDis - (int)((width - fixDis -2* holeDis) / holeDis) * holeDis;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);
        //吊装孔
        swModelLevel2.ChangeDim("Dis@SketchTopHole", 4*holeDis - midRoofTopHoleDis);

        #region MidRoof铆螺母孔
        swModelLevel2.ChangeDim("Dis@LPatternMidRoofNut", midRoofNutDis);
        #endregion

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion

        #region UV HOOD
        if (uvLightType!=UvLightType_e.NA)
        {
            if (bluetooth) swCompLevel2.UnSuppress("BluetoothCable");
            else swCompLevel2.Suppress("BluetoothCable");
            if (sidePanel is SidePanel_e.左 or SidePanel_e.双) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        else
        {
            swCompLevel2.Suppress("BluetoothCable");
            if (marvel) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        #endregion

        #region IR
        if (marvel) swCompLevel2.UnSuppress("IrLhc2");
        else swCompLevel2.Suppress("IrLhc2");
        #endregion
    }

    private void FNHA0002(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, SidePanel_e sidePanel, bool bluetooth, bool ledLogo, bool waterCollection, double frontPanelNutDis)
    {
        //新风CJ孔数量和新风CJ孔第一个CJ距离边缘距离
        const double cjHoleDis = 32d;//CJ孔间距
        int frontCjNo = (int)((length - cjHoleDis) / cjHoleDis) + 1;
        double frontCjFirstDis = (length - (frontCjNo - 1) * cjHoleDis) / 2d;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);


        //第一个CJ孔距离边缘
        swModelLevel2.ChangeDim("Dis@SketchCjSide", frontCjFirstDis);

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion

        #region Logo与蓝牙
        if (bluetooth) swCompLevel2.UnSuppress("Bluetooth");
        else swCompLevel2.Suppress("Bluetooth");
        if (ledLogo) swCompLevel2.UnSuppress("Logo");
        else swCompLevel2.Suppress("Logo");
        #endregion

        #region 集水翻边
        if (waterCollection && (sidePanel == SidePanel_e.右 || sidePanel == SidePanel_e.双)) swCompLevel2.UnSuppress("DrainChannelRight");
        else swCompLevel2.Suppress("DrainChannelRight");

        if (waterCollection && (sidePanel == SidePanel_e.左|| sidePanel == SidePanel_e.双)) swCompLevel2.UnSuppress("DrainChannelLeft");
        else swCompLevel2.Suppress("DrainChannelLeft");
        #endregion
    }




    private void FNHA0085(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, double midRoofNutDis, double frontPanelNutDis, ExhaustType_e exhaustType)
    {
        //因为后方一点距离前端固定90，这里计算前端一点移动的距离
        var exWidth = exhaustType is ExhaustType_e.CMOD ? 294d : 535d;//排风宽度
        const double suWidth = 360d;//新风宽度
        const double holeDis = 50d;//两孔间距，槽钢开孔50
        var fixDis = exWidth+suWidth+ 90d;//减去的固定间距为孔距边90和新风排风宽度

        var midRoofTopHoleDis = width - fixDis - (int)((width - fixDis -2* holeDis) / holeDis) * holeDis;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);
        //吊装孔
        swModelLevel2.ChangeDim("Dis@SketchTopHole", 4*holeDis - midRoofTopHoleDis);

        #region MidRoof铆螺母孔
        swModelLevel2.ChangeDim("Dis@LPatternMidRoofNut", midRoofNutDis);
        #endregion

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion
    }

    private void FNHA0086(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, SidePanel_e sidePanel, bool waterCollection, double frontPanelNutDis)
    {
        //新风CJ孔数量和新风CJ孔第一个CJ距离边缘距离
        const double cjHoleDis = 32d;//CJ孔间距
        int frontCjNo = (int)((length - cjHoleDis) / cjHoleDis) + 1;
        double frontCjFirstDis = (length - (frontCjNo - 1) * cjHoleDis) / 2d;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);

        //第一个CJ孔距离边缘
        swModelLevel2.ChangeDim("Dis@SketchCjSide", frontCjFirstDis);

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion

        #region 集水翻边
        if (waterCollection && (sidePanel == SidePanel_e.右 || sidePanel == SidePanel_e.双)) swCompLevel2.UnSuppress("DrainChannelRight");
        else swCompLevel2.Suppress("DrainChannelRight");

        if (waterCollection && (sidePanel == SidePanel_e.左|| sidePanel == SidePanel_e.双)) swCompLevel2.UnSuppress("DrainChannelLeft");
        else swCompLevel2.Suppress("DrainChannelLeft");
        #endregion
    }

    private void FNHA0003(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double suHeight, double midRoofNutDis, double frontPanelNutDis)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length - 2d);
        swModelLevel2.ChangeDim("Height@SketchBase", suHeight - 119d);

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion

    }

    private void FNHA0049(AssemblyDoc swAssyLevel1, string suffix, string partName, double innerRadius)
    {
        //新风CJ孔数量和新风CJ孔第一个CJ距离边缘距离
        const double cjHoleDis = 32d;//CJ孔间距
        double beta = Math.PI - 2 * Math.Asin(400d / innerRadius);//圆心角弧度
        double innerRound = innerRadius * beta - 4d;//弧长
        int innerCjNo = (int)((innerRound - 30d) / cjHoleDis) + 1;//CJ孔数量
        double innerCjFirstDis = (innerRound - (innerCjNo - 1) * cjHoleDis) / 2d;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Radius@SketchBase", innerRadius);

        //第一个CJ孔距离边缘
        swModelLevel2.ChangeDim("Dis@SketchCjSide", innerCjFirstDis);
    }

    private void FNHA0050(AssemblyDoc swAssyLevel1, string suffix, string partName, double outerRadius, double innerRadius)
    {
        //新风CJ孔数量和新风CJ孔第一个CJ距离边缘距离
        const double cjHoleDis = 32d;//CJ孔间距
        double beta = Math.PI - 2 * Math.Asin(400d / innerRadius);//圆心角弧度
        double downRound = beta * (outerRadius - 45d);
        int downCjNo = (int)((downRound - 30d) / cjHoleDis) + 1;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("OuterRadius@SketchBase", outerRadius-1d);
        swModelLevel2.ChangeDim("InnerRadius@SketchBase", innerRadius+1d);

        //第一个CJ孔距离边缘
        swModelLevel2.ChangeDim("Middle@SketchCj", 2d*outerRadius-90d);

        swModelLevel2.ChangeDim("Dis@CirPatternCj", beta*1000d);//弧度
        swModelLevel2.ChangeDim("Number@CirPatternCj", downCjNo);//数量


    }

    private void FNHA0051(AssemblyDoc swAssyLevel1, string suffix, string partName, double outerRadius, double innerRadius, double netLength)
    {
        //新风CJ孔数量和新风CJ孔第一个CJ距离边缘距离
        const double cjHoleDis = 32d;//CJ孔间距
        double beta = Math.PI - 2 * Math.Asin(400d / innerRadius);//圆心角弧度
        double downRound = beta * (outerRadius - 45d);
        int downCjNo = (int)((downRound - 30d) / cjHoleDis) + 1;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("OuterRadius@SketchBase", outerRadius-1d);
        swModelLevel2.ChangeDim("InnerRadius@SketchBase", innerRadius+1d);

        //第一个CJ孔距离边缘
        swModelLevel2.ChangeDim("Radius@SketchNut", outerRadius-45d);
        swModelLevel2.ChangeDim("Length@SketchNut", netLength-50d);
    }

    private void FNHM0020(AssemblyDoc swAssyLevel1, string suffix, string partName, double outerRadius, bool bluetooth)
    {
        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Radius@SketchFlange", outerRadius-1d);

        if (bluetooth) swCompLevel2.UnSuppress("Bluetooth");
        else swCompLevel2.Suppress("Bluetooth");

    }

    private void FNHA0128(AssemblyDoc swAssyLevel1, string suffix, string partName, double innerRadius)
    {
        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("OuterRadius@SketchBase", innerRadius-1d);
        swModelLevel2.ChangeDim("InnerRadius@SketchBase", innerRadius-39d);
    }
    #endregion

    #region ITS700
    private void FSHA0006(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, double midRoofNutDis, ExhaustType_e exhaustType)
    {
        //因为后方一点距离前端固定90，这里计算前端一点移动的距离
        var exWidth = exhaustType is ExhaustType_e.CMOD ? 294d : 535d;//排风宽度
        const double suWidth = 360d;//新风宽度
        const double holeDis = 50d;//两孔间距，槽钢开孔50
        var fixDis = exWidth+suWidth+ 90d;//减去的固定间距为孔距边90和新风排风宽度

        var midRoofTopHoleDis = width - fixDis - (int)((width - fixDis -2* holeDis) / holeDis) * holeDis;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);
        //吊装孔
        swModelLevel2.ChangeDim("Dis@SketchTopHole", 4*holeDis - midRoofTopHoleDis);

        #region MidRoof铆螺母孔
        swModelLevel2.ChangeDim("Dis@LPatternMidRoofNut", midRoofNutDis);
        #endregion

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region UV HOOD
        if (uvLightType!=UvLightType_e.NA)
        {
            if (bluetooth) swCompLevel2.UnSuppress("BluetoothCable");
            else swCompLevel2.Suppress("BluetoothCable");
            if (sidePanel is SidePanel_e.左 or SidePanel_e.双) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        else
        {
            swCompLevel2.Suppress("BluetoothCable");
            if (marvel) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        #endregion

        #region IR
        if (marvel) swCompLevel2.UnSuppress("IrLhc2");
        else swCompLevel2.Suppress("IrLhc2");
        #endregion
    }


    private void FSHA0007(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, SidePanel_e sidePanel, bool bluetooth, bool ledLogo, bool waterCollection, double blackCoverDis)
    {
        //新风CJ孔数量和新风CJ孔第一个CJ距离边缘距离
        const double cjHoleDis = 32d;//CJ孔间距
        int frontCjNo = (int)((length - cjHoleDis) / cjHoleDis) + 1;
        double frontCjFirstDis = (length - (frontCjNo - 1) * cjHoleDis) / 2d;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);


        //第一个CJ孔距离边缘
        swModelLevel2.ChangeDim("Dis@SketchCjSide", frontCjFirstDis);

        #region 黑色盖板
        swModelLevel2.ChangeDim("Dis@LPatternBlackCover", blackCoverDis);
        #endregion

        #region Logo与蓝牙
        if (bluetooth) swCompLevel2.UnSuppress("Bluetooth");
        else swCompLevel2.Suppress("Bluetooth");
        if (ledLogo) swCompLevel2.UnSuppress("Logo");
        else swCompLevel2.Suppress("Logo");
        #endregion

        #region 集水翻边
        if (waterCollection && (sidePanel == SidePanel_e.右 || sidePanel == SidePanel_e.双)) swCompLevel2.UnSuppress("DrainChannelRight");
        else swCompLevel2.Suppress("DrainChannelRight");

        if (waterCollection && (sidePanel == SidePanel_e.左|| sidePanel == SidePanel_e.双)) swCompLevel2.UnSuppress("DrainChannelLeft");
        else swCompLevel2.Suppress("DrainChannelLeft");
        #endregion
    }


    private void FSHA0008(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double suHeight, double midRoofNutDis, double blackCoverDis)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length - 2d);
        //swModelLevel2.ChangeDim("Height@SketchBase", suHeight - 119d);
        swModelLevel2.ChangeDim("Height@SketchBase", 400d);

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternBlackCover", blackCoverDis);
        #endregion

    }


    private void FSHA0011(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, double midRoofNutDis, int supplySpigotNumber, double supplySpigotDis, ExhaustType_e exhaustType)
    {
        //因为后方一点距离前端固定90，这里计算前端一点移动的距离
        var exWidth = exhaustType is ExhaustType_e.CMOD ? 294d : 535d;//排风宽度
        const double suWidth = 360d;//新风宽度
        const double holeDis = 50d;//两孔间距，槽钢开孔50
        var fixDis = exWidth+suWidth+ 90d;//减去的固定间距为孔距边90和新风排风宽度

        var midRoofTopHoleDis = width - fixDis - (int)((width - fixDis -2* holeDis) / holeDis) * holeDis;

        var suToMiddle = supplySpigotDis * (supplySpigotNumber/2d-1)+supplySpigotDis/2d;//新风脖颈口距离中间位置

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);

        #region 新风脖颈
        if (supplySpigotNumber == 1)
        {
            swCompLevel2.Suppress("LPatternSu250");
            swModelLevel2.ChangeDim("ToMiddle@SketchSu250", 0);
        }
        else
        {
            swCompLevel2.UnSuppress("LPatternSu250");
            swModelLevel2.ChangeDim("ToMiddle@SketchSu250", suToMiddle);
            swModelLevel2.ChangeDim("Number@LPatternSu250", supplySpigotNumber);
            swModelLevel2.ChangeDim("Dis@LPatternSu250", supplySpigotDis);

        }
        #endregion

        //吊装孔
        swModelLevel2.ChangeDim("Dis@SketchTopHole", 4*holeDis - midRoofTopHoleDis);

        #region MidRoof铆螺母孔
        swModelLevel2.ChangeDim("Dis@LPatternMidRoofNut", midRoofNutDis);
        #endregion

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region UV HOOD
        if (uvLightType!=UvLightType_e.NA)
        {
            if (bluetooth) swCompLevel2.UnSuppress("BluetoothCable");
            else swCompLevel2.Suppress("BluetoothCable");
            if (sidePanel is SidePanel_e.左 or SidePanel_e.双) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        else
        {
            swCompLevel2.Suppress("BluetoothCable");
            if (marvel) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        #endregion

        #region IR
        if (marvel) swCompLevel2.UnSuppress("IrLhc2");
        else swCompLevel2.Suppress("IrLhc2");
        #endregion
    }


    #endregion

    #region F555
    private void FNHA0004(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, double midRoofNutDis, double frontPanelNutDis, int supplySpigotNumber, double supplySpigotDis)
    {
        //因为后方一点距离前端固定90，这里计算前端一点移动的距离
        const double exWidth = 535d;//排风宽度
        const double suWidth = 360d;//新风宽度
        const double holeDis = 50d;//两孔间距，槽钢开孔50
        const double fixDis = exWidth+suWidth+ 90d;//减去的固定间距为孔距边90和新风排风宽度

        var midRoofTopHoleDis = width - fixDis - (int)((width - fixDis -2* holeDis) / holeDis) * holeDis;
        var suToMiddle = supplySpigotDis * (supplySpigotNumber/2d-1)+supplySpigotDis/2d;//新风脖颈口距离中间位置

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);

        #region 新风脖颈
        if (supplySpigotNumber == 1)
        {
            swCompLevel2.Suppress("LPatternSu250");
            swModelLevel2.ChangeDim("ToMiddle@SketchSu250", 0);
        }
        else
        {
            swCompLevel2.UnSuppress("LPatternSu250");
            swModelLevel2.ChangeDim("ToMiddle@SketchSu250", suToMiddle);
            swModelLevel2.ChangeDim("Number@LPatternSu250", supplySpigotNumber);
            swModelLevel2.ChangeDim("Dis@LPatternSu250", supplySpigotDis);

        }
        #endregion

        //吊装孔
        swModelLevel2.ChangeDim("Dis@SketchTopHole", 4*holeDis - midRoofTopHoleDis);

        #region MidRoof铆螺母孔
        swModelLevel2.ChangeDim("Dis@LPatternMidRoofNut", midRoofNutDis);
        #endregion

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion

        #region UV HOOD
        if (uvLightType!=UvLightType_e.NA)
        {
            if (bluetooth) swCompLevel2.UnSuppress("BluetoothCable");
            else swCompLevel2.Suppress("BluetoothCable");
            if (sidePanel == SidePanel_e.左 || sidePanel== SidePanel_e.双) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        else
        {
            swCompLevel2.Suppress("BluetoothCable");
            if (marvel) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        #endregion

        #region IR
        if (marvel) swCompLevel2.UnSuppress("IrLhc2");
        else swCompLevel2.Suppress("IrLhc2");
        #endregion
    }

    private void FNHA0007(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double suHeight, double midRoofNutDis, double frontPanelNutDis)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length - 2d);
        swModelLevel2.ChangeDim("Height@SketchBase", suHeight - 119d);

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);

        #endregion

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion

    }

    //镀锌板
    private void FNHA0006(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double frontPanelNutDis)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length - 6d);
        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion
    }

    //新风滑门导轨
    private void FNHA0010(AssemblyDoc swAssyLevel1, string suffix, string partName, double length)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length - 200d);
    }
    //华为新风滑门导轨使用排风的结构
    private void FNHA0097(AssemblyDoc swAssyLevel1, string suffix, string partName, double length)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length - 200d);
    }
    #endregion

    #region 法国烟罩
    private void FNHA0111(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double suHeight, double frontPanelNutDis)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length);
        swModelLevel2.ChangeDim("Height@SketchBase", suHeight - 118d);

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", frontPanelNutDis);
        #endregion

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion

    }
    private void FNHA0112(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double frontPanelNutDis)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length);
        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion
    }

    private void FNHA0116(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, bool marvel, double frontPanelNutDis, LightType_e lightType, int spotLightNumber, double spotLightDistance, bool ansul, int ansulDropNumber, double ansulDropToFront, double ansulDropDis1, double ansulDropDis2, double ansulDropDis3, double ansulDropDis4, double ansulDropDis5)
    {
        const double supply = 365d;
        const double light = 251d;
        const double exhaust = 535d;
        var midWidth = (width - exhaust - light - supply) / 2d;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);
        //随着烟罩宽度变化，等距MidRoof,
        //2024.4.8，长了1mm，改短2.5->1.5
        swModelLevel2.ChangeDim("Width@SketchBase", midWidth + 1.5d);

        #region 前面板螺丝孔
        swModelLevel2.ChangeDim("Dis@LPatternFrontPanelNut", frontPanelNutDis);
        #endregion

        #region IR
        if (marvel) swCompLevel2.UnSuppress("IrLhc2");
        else swCompLevel2.Suppress("IrLhc2");
        #endregion

        #region 灯具选项，灯板长度-47d
        //随着烟罩长度的变化，MidRoof侧板根据灯具的不同发生变化，长灯1329，短灯755,总长多减去2d
        //注意新风和排风零件随着变更长度，以及侧板长度变更
        var lightLength = lightType is LightType_e.长灯 ? 1329d :
            lightType is LightType_e.短灯 ? 755d : (spotLightNumber-1)*spotLightDistance+200d;
        swModelLevel2.ChangeDim("Length@SketchLight", lightLength-47d);
        #endregion

        #region 太短的时候删除孔
        if (width > 1200d)
        {
            swCompLevel2.Suppress("DeleteFaceShort");
        }
        else
        {
            swCompLevel2.UnSuppress("DeleteFaceShort");
        }
        #endregion

        #region ANSUL选项
        swCompLevel2.Suppress("AnsulDrop1");
        swCompLevel2.Suppress("AnsulDrop2");
        swCompLevel2.Suppress("AnsulDrop3");
        swCompLevel2.Suppress("AnsulDrop4");
        swCompLevel2.Suppress("AnsulDrop5");
        if (ansul)
        {
            #region Ansul下喷
            if (ansulDropNumber > 0)
            {
                swCompLevel2.UnSuppress("AnsulDrop1");
                swModelLevel2.ChangeDim("Dis@SketchAnsulDrop1", ansulDropDis1);
                swModelLevel2.ChangeDim("DisY@SketchAnsulDrop1", ansulDropToFront);
            }
            if (ansulDropNumber > 1)
            {
                swCompLevel2.UnSuppress("AnsulDrop2");
                swModelLevel2.ChangeDim("Dis@SketchAnsulDrop2", ansulDropDis2);
            }
            if (ansulDropNumber > 2)
            {
                swCompLevel2.UnSuppress("AnsulDrop3");
                swModelLevel2.ChangeDim("Dis@SketchAnsulDrop3", ansulDropDis3);
            }
            if (ansulDropNumber > 3)
            {
                swCompLevel2.UnSuppress("AnsulDrop4");
                swModelLevel2.ChangeDim("Dis@SketchAnsulDrop4", ansulDropDis4);
            }
            if (ansulDropNumber > 4)
            {
                swCompLevel2.UnSuppress("AnsulDrop5");
                swModelLevel2.ChangeDim("Dis@SketchAnsulDrop5", ansulDropDis5);
            }
            #endregion
        }
        #endregion
    }

    private void FNHA0117(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, double frontPanelNutDis, int supplySpigotNumber, double supplySpigotDis)
    {
        var suToMiddle = supplySpigotDis * (supplySpigotNumber/2d-1)+supplySpigotDis/2d;//新风脖颈口距离中间位置

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length);

        #region 新风脖颈

        if (supplySpigotNumber == 0)
        {
            swCompLevel2.UnSuppress("TypeI");
            swCompLevel2.Suppress("TypeF");
            swCompLevel2.Suppress("LPatternSu250");
        }
        else if (supplySpigotNumber == 1)
        {
            swCompLevel2.Suppress("TypeI");
            swCompLevel2.UnSuppress("TypeF");
            swCompLevel2.Suppress("LPatternSu250");
            swModelLevel2.ChangeDim("ToMiddle@SketchSu250", 0);
        }
        else
        {
            swCompLevel2.Suppress("TypeI");
            swCompLevel2.UnSuppress("TypeF");
            swCompLevel2.UnSuppress("LPatternSu250");
            swModelLevel2.ChangeDim("ToMiddle@SketchSu250", suToMiddle);
            swModelLevel2.ChangeDim("Number@LPatternSu250", supplySpigotNumber);
            swModelLevel2.ChangeDim("Dis@LPatternSu250", supplySpigotDis);
        }
        #endregion

        //吊装孔
        //swModelLevel2.ChangeDim("Dis@SketchTopHole", 4*holeDis - midRoofTopHoleDis);

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", frontPanelNutDis);
        #endregion

        #region UV HOOD
        if (uvLightType!=UvLightType_e.NA)
        {
            if (bluetooth) swCompLevel2.UnSuppress("BluetoothCable");
            else swCompLevel2.Suppress("BluetoothCable");
            if (sidePanel == SidePanel_e.左 || sidePanel== SidePanel_e.双) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        else
        {
            swCompLevel2.Suppress("BluetoothCable");
            if (marvel) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        #endregion

        #region IR
        if (marvel)
        {
            swCompLevel2.UnSuppress("IrLhc2");
            swCompLevel2.UnSuppress("IrLhc2-2");
        }
        else
        {
            swCompLevel2.Suppress("IrLhc2");
            swCompLevel2.Suppress("IrLhc2-2");
        }
        #endregion
    }


    #endregion

    #region 华为烟罩
    private void FNHA0113(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, double midRoofNutDis)
    {
        //因为后方一点距离前端固定90，这里计算前端一点移动的距离
        const double exWidth = 535d;//排风宽度
        const double suWidth = 360d;//新风宽度
        const double holeDis = 50d;//两孔间距，槽钢开孔50
        const double fixDis = exWidth+suWidth+ 90d;//减去的固定间距为孔距边90和新风排风宽度

        var midRoofTopHoleDis = width - fixDis - (int)((width - fixDis -2* holeDis) / holeDis) * holeDis;

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);
        //吊装孔
        swModelLevel2.ChangeDim("Dis@SketchTopHole", 4*holeDis - midRoofTopHoleDis);

        #region MidRoof铆螺母孔
        swModelLevel2.ChangeDim("Dis@LPatternMidRoofNut", midRoofNutDis);
        #endregion

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region UV HOOD
        if (uvLightType!=UvLightType_e.NA)
        {
            if (bluetooth) swCompLevel2.UnSuppress("BluetoothCable");
            else swCompLevel2.Suppress("BluetoothCable");
            if (sidePanel is SidePanel_e.左 or SidePanel_e.双) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        else
        {
            swCompLevel2.Suppress("BluetoothCable");
            if (marvel) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        #endregion

        #region IR
        //if (marvel) swCompLevel2.UnSuppress("IrLhc2");
        //else swCompLevel2.Suppress("IrLhc2");
        #endregion
    }
    private void FNHA0108(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double width, SidePanel_e sidePanel, UvLightType_e uvLightType, bool bluetooth, bool marvel, double midRoofNutDis, int supplySpigotNumber, double supplySpigotDis)
    {
        //因为后方一点距离前端固定90，这里计算前端一点移动的距离
        const double exWidth = 535d;//排风宽度
        const double suWidth = 360d;//新风宽度
        const double holeDis = 50d;//两孔间距，槽钢开孔50
        const double fixDis = exWidth+suWidth+ 90d;//减去的固定间距为孔距边90和新风排风宽度

        var midRoofTopHoleDis = width - fixDis - (int)((width - fixDis -2* holeDis) / holeDis) * holeDis;
        var suToMiddle = supplySpigotDis * (supplySpigotNumber/2d-1)+supplySpigotDis/2d;//新风脖颈口距离中间位置

        var swCompLevel2 = swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@Base-Flange", length);
        #region 新风脖颈
        if (supplySpigotNumber == 1)
        {
            swCompLevel2.Suppress("LPatternSu250");
            swModelLevel2.ChangeDim("ToMiddle@SketchSu250", 0);
        }
        else
        {
            swCompLevel2.UnSuppress("LPatternSu250");
            swModelLevel2.ChangeDim("ToMiddle@SketchSu250", suToMiddle);
            swModelLevel2.ChangeDim("Number@LPatternSu250", supplySpigotNumber);
            swModelLevel2.ChangeDim("Dis@LPatternSu250", supplySpigotDis);

        }
        #endregion

        //吊装孔
        swModelLevel2.ChangeDim("Dis@SketchTopHole", 4*holeDis - midRoofTopHoleDis);

        #region MidRoof铆螺母孔
        swModelLevel2.ChangeDim("Dis@LPatternMidRoofNut", midRoofNutDis);
        #endregion

        #region 新风前面板卡口，距离与铆螺母数量相同，无需重复计算
        swModelLevel2.ChangeDim("Dis@LPatternPlug", midRoofNutDis);
        #endregion

        #region UV HOOD
        if (uvLightType!=UvLightType_e.NA)
        {
            if (bluetooth) swCompLevel2.UnSuppress("BluetoothCable");
            else swCompLevel2.Suppress("BluetoothCable");
            if (sidePanel == SidePanel_e.左 || sidePanel== SidePanel_e.双) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        else
        {
            swCompLevel2.Suppress("BluetoothCable");
            if (marvel) swCompLevel2.UnSuppress("JunctionBoxUv");
            else swCompLevel2.Suppress("JunctionBoxUv");
        }
        #endregion

        #region IR
        //if (marvel) swCompLevel2.UnSuppress("IrLhc2");
        //else swCompLevel2.Suppress("IrLhc2");
        #endregion
    }
    #endregion

    #region BackCj
    private void FNHA0084(AssemblyDoc swAssyLevel1, string suffix, string partName, double length, double height, double firstCjDis, double cjSpigotToRight)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length);
        swModelLevel2.ChangeDim("Height@SketchBase", height+1d);
        swModelLevel2.ChangeDim("Dis@SketchCj", firstCjDis);
        swModelLevel2.ChangeDim("ToRight@SketchSpigot", cjSpigotToRight);
    }
    private void FNCJ0016(AssemblyDoc swAssyLevel1, string suffix, string partName, double length)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Length@SketchBase", length-10d);
    }
    private void FNHE0102(AssemblyDoc swAssyLevel1, string suffix, string partName, double height)
    {
        swAssyLevel1.UnSuppress(out var swModelLevel2, suffix, partName, Aggregator);
        swModelLevel2.ChangeDim("Height@SketchBase", height-1d);
    }
    #endregion
}